/*
 * BootQuad.java
 *
 * Created on May 31, 2005, 10:29 PM
 */

package aa.application.AdaptiveQuad;

import aa.core.Platform;
import aa.core.CyberOrg;
import aa.core.ActorName;
import aa.core.ActorMessage;
import aa.gui.View;

/**
 *
 * @author  xinghuizhao
 */
public class BootQuad {
    
    /** Creates a new instance of BootQuad */
    public BootQuad() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        
        System.out.println(System.currentTimeMillis());
        
        Integer myPort = new Integer(8077);
        
        //View myView = new View(myPort);
        
        Platform pPlatform=new Platform(null,myPort);
        
        pPlatform.start();
        
        Object[] nullobja={};
        
        CyberOrg fibCyber=(CyberOrg)pPlatform.createCyberOrg(new Long(500000000), new Long(20000000), new Long(1000),"aa.core.FacilitatorActor", nullobja);
        
        ActorName facility=fibCyber.getFacilitator();
        
        ActorName fibonacciActor=null;
        
        Object[] quadAgs = {new Double(0.0001)};
        
        
        ActorName quadActor=pPlatform.createActor(facility, "aa.application.AdaptiveQuad.QuadActor_noRes", quadAgs);
        
        
        //adapt for QuadActor (in order to allocate resource)
        
        Object[] quadAgs2 = {new Double(0.0001),quadActor};
        
        ActorName quadActor2=pPlatform.createActor(facility, "aa.application.AdaptiveQuad.QuadActor_noRes", quadAgs2);
        
        //end adapt
        
        Object[] Ags=new Object[4];
        Ags[0] = new Double(0);
        Ags[1] = new Double(1);
        Ags[2] = quadActor2;
        Ags[3] = "result";
        
        ActorMessage request=new ActorMessage(pPlatform.getActorNameOfPlatform(), 
                                                quadActor2, "quadrature",Ags, false);
        
        pPlatform.sendMessage(request);
    }
    
}
